/**
* Copyright (c) 2016-2100 yunclouds
*/
package com.yunqian.web;

import com.yunqian.redot.domain.Params;
import com.yunqian.redot.service.ParamsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * Describe: 系统配置表rn控制器
 *
 * @author zsy
 * 2018-12-08 11:02:35
 */
 @RestController
 @RequestMapping("/api/params")
public class ParamsController {

     @Autowired
     private ParamsService paramsService;

    /**
     * 局部更新数据
     *
     * @param modifyData 待更新的数据
     * @return
     */
    @PutMapping("/modify")
    public Params update(@RequestBody Map<String, Object> modifyData) {
        return paramsService.update(1L, modifyData);
    }

    /**
     * 根据id获取详情
     *
     * @param
     * @return
     */
    @GetMapping("/base")
    public Params detail() {
        // 数据库只有一条记录
        return paramsService.findStrictOne(1L);
    }

}
